package com.myproject.thread.join;

public class AnotherThread extends Thread {

    public Thread t;

    public void setT(Thread t) {
        this.t = t;
    }

    @Override
    public void run() {

        try {
            t.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("this thread over");
    }
}
